load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")

oncall("fboss_agent_push")

cpp_library(
    name = "fsdb_test_clients",
    srcs = [
        "FsdbTestClients.cpp",
    ],
    headers = [
        "FsdbTestClients.h",
    ],
    exported_deps = [
        "fbsource//third-party/googletest:gtest",
        "//fboss/fsdb/client:fsdb_pub_sub",
        "//fboss/fsdb/client:fsdb_stream_client",
        "//fboss/fsdb/if:fsdb_model",
        "//fboss/lib:common_utils",
        "//folly:synchronized",
        "//folly/container:f14_hash",
        "//folly/logging:logging",
        "//thrift/lib/cpp2/protocol:protocol",
    ],
)

cpp_unittest(
    name = "fsdb_pub_sub_tests",
    srcs = [
        "FsdbPubSubManagerTest.cpp",
        "FsdbPubSubTest.cpp",
        "FsdbPublisherTest.cpp",
        "FsdbStreamClientTest.cpp",
    ],
    deps = [
        ":fsdb_test_clients",
        "//fb303:service_data",
        "//fboss/fsdb/client:fsdb_pub_sub",
        "//fboss/fsdb/client:fsdb_stream_client",
        "//fboss/fsdb/if:fsdb_model",
        "//fboss/fsdb/oper:extended_path_builder",
        "//fboss/fsdb/server:handler",
        "//fboss/fsdb/tests/utils:fsdb_test_server",
        "//fboss/lib:common_utils",
        "//fboss/lib/thrift_service_client:thrift-service-client",
        "//folly/coro:blocking_wait",
        "//folly/io/async:scoped_event_base_thread",
        "//folly/logging:log_level",
        "//folly/logging:logging",
        "//folly/synchronization:baton",
        "//thrift/lib/cpp2/protocol:protocol",
    ],
)
